<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>TubePainter - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
	<h1 translate="no">TubePainter</h1>
		<section>
			<header>
				<div class="class-description"><p>This module can be used to paint tube-like meshes
along a sequence of points. This module is used in a XR
painter demo.</p></div>
				<h2>Code Example</h2>
				<div translate="no"><pre><code class="language-js">const painter = new TubePainter();
scene.add( painter.mesh );
</code></pre></div>
			</header>
			<article>
				<h2 class="subsection-title">Import</h2>
				<p><span translate="no">TubePainter</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
				<pre><code class="language-js">import { TubePainter } from 'three/addons/misc/TubePainter.js';</code></pre>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="TubePainter" translate="no">new <a href="#TubePainter">TubePainter</a><span class="signature">()</span> </h3>
					<div class="method">
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="mesh" translate="no">.<a href="#mesh">mesh</a><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> </h3>
					<div class="description">
						<p>The &quot;painted&quot; tube mesh. Must be added to the scene.</p>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="lineTo" translate="no">.<a href="#lineTo">lineTo</a><span class="signature">( position : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Draw a stroke from the current position to the given one.
This method extends the tube while drawing with the XR
controllers.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>position</strong>
									</td>
									<td class="description last">
										<p>The destination position.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="moveTo" translate="no">.<a href="#moveTo">moveTo</a><span class="signature">( position : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Moves the current painting position to the given value.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>position</strong>
									</td>
									<td class="description last">
										<p>The new painting position.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="setColor" translate="no">.<a href="#setColor">setColor</a><span class="signature">( color : <span class="param-type"><a href="Color.html">Color</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Sets the color of newly rendered tube segments.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>color</strong>
									</td>
									<td class="description last">
										<p>The color.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( size : <span class="param-type">number</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Sets the size of newly rendered tube segments.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>size</strong>
									</td>
									<td class="description last">
										<p>The size.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
					<div class="method">
						<div class="description">
							<p>Updates the internal geometry buffers so the new painted
segments are rendered.</p>
						</div>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/TubePainter.js" translate="no" target="_blank" rel="noopener">examples/jsm/misc/TubePainter.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>